import QtQuick 2.0
import QtQuick.Controls 2.2

Item {
      ProgressBar {
          id: progressBar
          x:0
          y:20

          width: parent.width / 3
          height: 100
          value: 0

          Label{
              id:progressBarLabel
              anchors.left: progressBar.right
              anchors.verticalCenter: progressBar.verticalCenter
              text: qsTr("0%")
          }
      }

      Connections {
          target: Swupdate

          function onMsgChanged() {
                progressBarLabel.text = Swupdate.getProgressMsgALL();
                progressBar.value = Swupdate.getProgressMsgInt("cur_percent") / 100;
          }

          function onStart() {
                root.visible = true;
          }

          function onStop() {
                root.visible = false;
          }
      }
}
